<template>
  <div class="login">
    登录
    <div @click="login">点击登录</div>
    <div class="test">
      <div @click="goTo('/home/my')">go</div>
    </div>
    <div class="test2">
      <div @click="goTo('/not')">toPath</div>
    </div>

    <i class="fas fa-camera fa-sm"></i>
    <i class="fas fa-camera fa-lg"></i>
    <i class="fas fa-camera fa-2x"></i>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
    <div>登录</div>
  </div>
</template>

<script>
const md5 = require("js-md5");
const sha1 = require("js-sha1");
const convertUnits = require("convert-units");

export default {
  inject: ["defaultAvatar"],
  components: {},
  data() {
    return {};
  },
  computed: {},
  mounted() {
    let unit = convertUnits(12000).from("b").toBest();
    console.log("这里是：", unit.val, unit.unit.toUpperCase());
    console.log("login first");
    this.$loadend();
  },
  methods: {
    login() {
      this.$http
        .post(this.$urls.LOGIN, {
          name: "this.username",
          password: "md5(this.password)",
        })
        .then((res) => {
          console.log(res);
        });
    },
    goTo(path) {
      this.$router.push({
        path: path,
      });
    },
  },
};
</script>

<style lang="less">
.login {
  background-color: #fff;
}

.test {
  color: @primary-color;
}
</style>

<style lang="scss">
.test2 {
  color: $red;
}
</style>
